#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
#define ll long long
#define inf 0x3f3f3f3f
const int maxn = 2e4 + 100;
struct node
{
    int x;
    int y1;
    int y2;
} q[maxn];
int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
        scanf("%d %d %d", &q[i].x, &q[i].y1, &q[i].y2);
    }
    for (int i = 1; i <= n; i++)
    {
        double minn = inf, maxx = -inf;
        int xup, yup;
        //xup=yup=0;
        int j;
        for (j = 1; j <= n; j++)
        {
            if (j == i)
                continue;
            int flag = 1;
            double up = (q[j].y1 * 1.0 - q[i].y2 * 1.0) / (q[j].x * 1.0 - q[i].x * 1.0);
            double down = (q[j].y2 * 1.0 - q[i].y2 * 1.0) / (q[j].x * 1.0 - q[i].x * 1.0);
            if (up < down)
                swap(up, down), flag = 0;
            if (down > minn || up < maxx)
                break;
            maxx = max(maxx, down);//小斜率中最大的
            if (minn > up)//大斜率中最小的
            {
                minn = up;
                xup = q[j].x;
                yup = q[j].y1;
                if (!flag)
                {
                    yup = q[j].y2;
                }
            }
        }
        if (j == n + 1)
        {
            printf("%d %d %d %d\n", q[i].x, q[i].y2, xup, yup);
            break;
        }
    }
    return 0;
}